import Vue from 'vue'

const VueEventBus = new Vue()

export const sendMsgEvent = (msgCode, msgContent) => VueEventBus.$emit(msgCode, msgContent)
export const regMsgEvent = (msgCode, cb) => VueEventBus.$on(msgCode, msg => cb && cb(msg))
export const removeMsgEvent = msgCode => VueEventBus.$off(msgCode)

export const EVENT_TYPE = {
  goLogin: 'goLogin',
  navStepItemClick: 'navStepItemClick',
  updateQueListSeq: 'updateQueListSeq',
  scrollToQueItem: 'scrollToQueItem',
}
